<?php session_start();
include "constants.php";

$PPP=$_POST["province"];
$_SESSION['ppp'] = $_POST["province"];
if(!isset($_SESSION['ppp']))
{echo "You are in the wrong page since this is not "."<a href='index.html'>www.cash2u.ca</a>"." application page, please start your ". "<a href='apply.php'>application here</a> now, thank you for your cooperation!";
exit();
}

$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); 

if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
} 
mysql_select_db(DB_NAME);

$sql = "SELECT Times FROM `NewCustomers` WHERE ID = 2";

$resu=mysql_query($sql);

$row=mysql_fetch_array($resu);

$NewCustomers=$row['Times']; 

$_SESSION['NewCusts'] = $NewCustomers;

$sqlupdate="UPDATE `NewCustomers` SET Times=$NewCustomers+1 WHERE ID = 2";

$Ups=mysql_query($sqlupdate);


$sqlPROV = "SELECT Rates FROM `ProvinceRates` WHERE Province = '".$_SESSION['ppp']."'";

$PRate=mysql_query($sqlPROV);

$Prow=mysql_fetch_array($PRate);

$_SESSION['PRates']=$Prow['Rates']; 


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Cash2u.ca: Payday loan online application for Canadians</title>
<META NAME="Keywords" CONTENT="How it works, payday loans,cash advance, payday loan, pay day loans, payday cash advance, online, unsecured loans, no fax payday loans, payday advance, payday cash loan, payday loans, cash advance, paycheque loans, short term,fast cash, unsecured personal loans, pay day loan, no fax loans, no faxing payday loans, no fax cash advance, faxless payday loans, short term loans, unsecured personal loan, unsecured loan, online loans, quick cash, no fax payday loan, payday cash advance, cash advance, online loan, fast cash loans, signature loan, no fax pay day loans, pay day advance, payday loans no faxing required, payday loan online, no faxing cash advance, payday loans no faxing, canada, money mart, money here, quick cash,check,cashing,easy,tax, bill,payment,currency,card,credit,Easy Cash Advances,Internet Payday loans, Payroll Advance, Payday Loan Services,Online Payday Advances, Online Payday Loan Provider, Pay Day">
<META NAME="Description" CONTENT=Cash2u.ca offers online payday loans and cash advance for Canadians">

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="../css/jquery.maskedinput.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../css/main_style.css"/>
<link rel="stylesheet" type="text/css" href="../css/index.css"/>
<script type="text/javascript" src="../css/validationjava.js"></script>
<script src="../css/formavalidates.js" type="text/javascript"></script> 

<style type="text/css">@import "../css/jquery.datepick.css";</style>
<script type="text/javascript" src="../css/jquery.datepick.js"></script>
<script type="text/javascript">
$(function() {
	$('#datebirth').datepick({yearRange: '1900:+1'});
	$('#datein').datepick({yearRange: '1900:+1'});
});
function showDate(date) {
	alert('The date chosen is ' + date);
}
</script>
<script type="text/javascript" src="../css/formretain.js">
/***********************************************
* Recall Form Values script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
</head>
<body>
<div id="maincontainer">

<div id="headsection">
<div id="headback">
<br/><br/><br/><h1><a style="color:white;" href="apply.php">Cash to you</a></h1><p id="headpara"><a style="color:white;" href="apply.php">Simple Easy Fast - Your payday loan</a></p>
</div>
</div>

<table cellspacing="4" cellpadding="1" border="0" style="margin:5px;height:50px;width:740px;background-color:#084c8d;border:1px solid #e5e5e5;color:white;font-size:110%;font-weight:bold;">
<tr><td width="20"></td>
<td width="90" align="center"><a class="headlink" href="index.html">HOME</a></td>
<td width="90" align="center"><a class="headlink" href="apply.php">APPLY</a></td>
<td width="130" align="center"><a class="headlink" href="member.php"><span class="displace">MEMBERS</span></a></td>
<td width="110" align="center"><a class="headlink" href="career.php"><span class="displace">CAREER</span></a></td>
<td width="90" align="center"><a class="headlink" href="faqs.php"><span class="displace">FAQ's</span></a></td>
<td width="90" align="center"><a class="headlink" href="contact.php"><span class="displace">CONTACT</span></a></td>
<td width="140"></td>
</tr>
</table>

<div id="content">
    	<div id="Apphead" class="Apphead" style="margin: 20px 0 0 5px;">
        	<h3>LOAN APPLICATION</h3>
		<p>Returning customers, please <a style="color:green;" href="member.php">apply here</a> for a faster application<br/>
		   Please fill all the fields for this online application unless indicated 			as optional </p>
            
    	</div>
        <!-- EOD of Application Head -->    
          
        <div id="TopSectionWrapper" class="PersonalInfo">
		<div id="NewCust" class="NewCust">New Customer <?php echo "00".$NewCustomers;?></br></div>

	<!--Starting of Personal Information Section-->
	<div id="TitleInfo" class="TitleInfo"><h2>Your Personal Information - Step 1</h2></div>
	<form name="Profiles" method="post" action="applysecondpart.php" id="Profiles">
	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
                <td width="140" align="right">First Name:</td>
                <td width="170"><input type="text" style="width: 150px;" value="" name="fName" class="memorize"></td>
                <td width="230" align="right">Last Name:</td>
                <td width="160"><input type="text" style="width: 150px;" name="lName" value="" class="memorize"></td>
		</tr>
		

		<tr>
                <td width="140" align="right">Gender:</td>
                <td width="170">
			<select style="width: 130px;" name="gender">
				<option value="">- Select -</option>
				<option value="female" >female</option>
				<option value="male" >male</option>
			</select>
                <td width="230" align="right">Social Insurance Number:<br/><span style="color:green;font-size:small;">(SIN: 999-999-999)</span></td>
                <td width="160"><input type="text" style="width: 150px;" id="ssn" name="SIN" value="" class="memorize"></td>
		</tr>
				
		<tr>
                <td width="140" align="right">Date of Birth:<br/><span style="color:green;font-size:small;">(date: mm/dd/yyyy)</span></td>
                <td width="170"><input type="text" id="datebirth" style="width: 150px;" name="birthdate" class="memorize"/></td>
                <td width="230" align="right">Address:</td>
                <td width="160"><input type="text" style="width: 150px;" name="address" value="" class="memorize"></td>
		</tr>

		<tr>
                <td width="140" align="right">City:</td>
                <td width="170"><input type="text" style="width: 150px;" name="city" class="memorize"/></td>
                <td width="230" align="right">Province:</td>
                <td width="160">
		<select style="width: 150px;" name="mprovince">
		<option value="" <?php if($_POST["province"] == "") {echo "selected='selected'";}; ?>>Please Select your province</option>
                <option value="Alberta" <?php if($_POST["province"] == "Alberta") {echo "selected='selected'";}; ?>>Alberta</option>
                <option value="British Columbia" <?php if($_POST["province"] == "British Columbia") {echo "selected='selected'";}; ?>>British Columbia</option>
                <option value="Manitoba" <?php if($_POST["province"] == "Manitoba") {echo "selected='selected'";}; ?>>Manitoba</option>
                <option value="New Brunswick" <?php if($_POST["province"] == "New Brunswick") {echo "selected='selected'";}; ?>>New Brunswick</option>
                <option value="Newfoundland" <?php if($_POST["province"] == "Newfoundland") {echo "selected='selected'";}; ?>>Newfoundland</option>
                <option value="Northwest Territories" <?php if($_POST["province"] == "Northwest Territories") {echo "selected='selected'";}; ?>>Northwest Territories</option>
                <option value="Nova Scotia" <?php if($_POST["province"] == "Nova Scotia") {echo "selected='selected'";}; ?>>Nova Scotia</option>
                <option value="Nunavut" <?php if($_POST["province"] == "Nunavut") {echo "selected='selected'";}; ?>>Nunavut</option>
                <option value="Ontario" <?php if($_POST["province"] == "Ontario") {echo "selected='selected'";}; ?>>Ontario</option>
                <option value="Prince Edward Island" <?php if($_POST["province"] == "Prince Edward Island") {echo "selected='selected'";}; ?>>Prince Edward Island</option>
                <option value="Saskatchewan" <?php if($_POST["province"] == "Saskatchewan") {echo "selected='selected'";}; ?>>Saskatchewan</option>
                <option value="Yukon" <?php if($_POST["province"] == "Yukon") {echo "selected='selected'";}; ?>>Yukon</option>
                </select></td>
		</tr>


		<tr>
                <td width="140" align="right">Post Code:<br/><span style="color:green;font-size:small;">(Post Code:A9A-9A9)</span></td>
                <td width="170"><input type="text" id="post" name="postcode" style="width: 150px;" class="memorize"/></td>
                <td width="230" align="right">When did you move in:<br/><span style="color:green;font-size:small;">(Date: mm/dd/yyyy)</span></td>
                <td width="160"><input type="text" id="datein" style="width: 150px;" name="datein" value="" class="memorize"></td>
		</tr>

		<tr>
                <td width="140" align="right">Primary Phone:<br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999)</span></td>
                <td width="170"><input type="text" id="phonep"  name="primaryphone" style="width: 150px;" class="memorize"/></td>
                <td width="230" align="right">Work Phone:<br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999x99999)</span></td>
                <td width="160"><input type="text" id="phonew"  name="workphone" style="width: 150px;" value="" class="memorize"></td>
		</tr>

		<tr>
                <td width="140" align="right">Cell Phone <span style="color:green;font-size:small;">(optional):<br/>(Tel: (999) 999-9999)</span></td>
                <td width="170"><input type="text" id="phonec"  name="cellphone" style="width: 150px;" class="memorize"/></td>
                <td width="230" align="right">Driver License/Health Card #:</td>
                <td width="160"><input type="text" name="driver" style="width: 150px;" value="" class="memorize"></td>
		</tr>

		<tr>
                <td width="140" align="right">Email Address:<br/><span style="color:green;font-size:small;">(LoginID)</span></td>
                <td width="170"><input type="text" name="email" style="width: 150px;" class="memorize"/></td>
                <td width="230" align="right">Confirm Email Address:</td>
                <td width="160"><input type="text" name="cemail" style="width: 150px;" value="" class="memorize"></td>
		</tr>
		
		<tr>
                <td width="140" align="right">Password:</td>
                <td width="170"><input type="password" name="pwd" style="width: 150px;" class="memorize"/></td>
                <td width="230" align="right">Confirm Password:</td>
                <td width="160"><input type="password" name="cpwd" style="width: 150px;" value="" class="memorize"></td>
		</tr>

		<tr>
                <td width="140" align="right">Reference #1 Name:</td>
                <td width="170"><input type="text" name="r1name" style="width: 150px;" class="memorize"/></td>
                <td width="230" align="right">Reference #2 Name:<br/><span style="color:green;font-size:small;">(optional)</span></td>
                <td width="160"><input type="text" name="r2name" style="width: 150px;" value="" class="memorize"></td>
		</tr>
		
		<tr>
                <td width="140" align="right">Reference #1 Phone:<br/><span style="color:green;font-size:small;">(required)</span></td>
                <td width="170"><input type="text" id="phoner1"  name="r1phone" style="width: 150px;" class="memorize"/><br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999 x 99999)</span></td>
                <td width="230" align="right">Reference #2 Phone (optional):<br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999x99999)</span></td>
                <td width="160"><input type="text" id="phoner2"  name="r2phone" style="width: 150px;" value="" class="memorize"></td>
		</tr>


		<tr>
                <td width="140" align="right">Relationship :<br/><span style="color:green;font-size:small;">(with Reference  #1)</span></td>
                <td width="170"><input type="text" name="r1relation" style="width: 150px;" class="memorize"/></td>
                <td width="230" align="right">Where did you know:<br/><span style="color:green;font-size:small;">(www.cash2u.ca)</span></td>
                <td width="160">
		<select style="width: 150px;" name="advertisement">
			<option value="">- Select -</option>
			 <?php        			
        			$sql = "SELECT * FROM ADS";
        			$ADS = mysql_query($sql,$link);
        			while($row = mysql_fetch_array($ADS)) {        
            			echo ("<option value=\"$row[AID]\" " . ">$row[MEDIA]</option>");  }  ?>
		</select></td>
		</tr>
	</table>	
	
<!--for submit button-->
	<table>	
	<tr><td width="700" align="center"><input type="submit" value=" &nbsp;Next &gt;&gt; "/></td>
		</tr>

</table>
	</form>
<script src="../css/applysecond.js" type="text/javascript"></script>	
<div><img src="../images/security.gif"/></div>
<div id="footer">
<div id="imlinks"><b><strong>Copyright &#169 2011 Cash2u.ca All rights reserved</strong></b></div>
</div>

</div>


</body>
</html>






































